//封装演员模块相关接口


import myaxios from "../MyAxios"
import BASEURL from "../BaseUrl.js"
const BMDURL = BASEURL.BMDURL



const actorpApi = {

    //查询所有演员 ,返回Promise对象
queryAllActors (){
    let url = BMDURL + "/movie-actors"
    return myaxios.get(url,{page:1,pagesize:100})
},

//通过姓名模糊查询演员列表,要传参
/**
 * 
 * @param {Object} params 请求参数对象
 * @return Promise
 */
queryByNameLike(params){
    let url = `${BMDURL}/movie-actors/name`
    return myaxios.post(url,params)
},

/**
 * @param {Object} params 参数对象
 * @return Promise
 */
//新增演员
add(params){
    let url =  BMDURL + "/movie-actor/add"
    return myaxios.post(url,params)

},

/**
 * @param {Object} params 参数对象 {id:演员id}
 * @return Promise
 * 
 */
//删除演员
delete(params){
    let url =  BMDURL + "/movie-actor/del"
    return myaxios.post(url,params)

}
}

export default actorpApi